//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

#ifndef __SONGSHAN_SOW_FAULT_DSP_H_
#define __SONGSHAN_SOW_FAULT_DSP_H_

#include <omnetpp.h>
#include "packet_m.h"

using namespace omnetpp;
using namespace std;
#include <iostream>
#include <fstream>
#include <string>
#include <string.h>

#include <sstream>
#include <vector>
#define NUM_DSP 36

/**
 * TODO - Generated class
 */
class DSP : public cSimpleModule
{
public:
    virtual ~DSP();

  protected:
    virtual void initialize() override;
    virtual void handleMessage(cMessage *msg) override;
    Packet* generateMessage(const char* src, const char* dst); // packet 生成
    std::vector<std::vector<std::string>> readTraceFile(const std::string& filename); // 读取 trace 文件

  private:
    cMessage *begin_packet = nullptr; // 自消息
    std::vector<std::vector<std::string>> trace; // 将从文件中读取的内容保存至这里
    int trace_index; // trace 读取的位置
};

#endif
